﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Pertanyaan [dbo].[pertanyaan]
    /// </summary>
    public class Pertanyaan
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 5;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "P";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TableName = "[dbo].[pertanyaan]";
        /// <summary>
        /// Konstanta nama kolom idPertanyaan pada tabel
        /// </summary>
        public const string ColumnNameIdPertanyaan = "[id_pertanyaan]";
        /// <summary>
        /// Konstanta nama kolom isiPertanyaan pada tabel
        /// </summary>
        public const string ColumnNamePertanyaan = "[pertanyaan]";
        /// <summary>
        /// Konstanta nama kolom pilihanJawaban1 pada tabel
        /// </summary>
        public const string ColumnNamePilihanJawaban1 = "[pilihan_jawaban1]";
        /// <summary>
        /// Konstanta nama kolom pilihanJawaban2 pada tabel
        /// </summary>
        public const string ColumnNamePilihanJawaban2 = "[pilihan_jawaban2]";
        /// <summary>
        /// Konstanta nama kolom pilihanJawaban3 pada tabel
        /// </summary>
        public const string ColumnNamePilihanJawaban3 = "[pilihan_jawaban3]";
        /// <summary>
        /// Konstanta nama kolom pilihanJawaban4 pada tabel
        /// </summary>
        public const string ColumnNamePilihanJawaban4 = "[pilihan_jawaban4]";
        public const string ColumnNameBobotPillihanJawaban1 = "[bobot_pillihan_jawaban1]";
        public const string ColumnNameBobotPillihanJawaban2 = "[bobot_pillihan_jawaban2]";
        public const string ColumnNameBobotPillihanJawaban3 = "[bobot_pillihan_jawaban3]";
        public const string ColumnNameBobotPillihanJawaban4 = "[bobot_pillihan_jawaban4]";
        #endregion

        #region Fields
        /// <summary>
        /// [id_pertanyaan] CHAR(5) PRIMARY KEY
        /// </summary>
        private string idPertanyaan;
        /// <summary>
        /// [pertanyaan] TEXT NOT NULL
        /// </summary>
        private string isiPertanyaan;
        /// <summary>
        /// [pilihan_jawaban1] TEXT NOT NULL
        /// </summary>
        private string pilihanJawaban1;
        /// <summary>
        /// [pilihan_jawaban2] TEXT NOT NULL
        /// </summary>
        private string pilihanJawaban2;
        /// <summary>
        /// [pilihan_jawaban3] TEXT NOT NULL
        /// </summary>
        private string pilihanJawaban3;
        /// <summary>
        /// [pilihan_jawaban4] TEXT NOT NULL
        /// </summary>
        private string pilihanJawaban4;
        private int bobotPillihanJawaban1;
        private int bobotPillihanJawaban2;
        private int bobotPillihanJawaban3;
        private int bobotPillihanJawaban4;
        #endregion

        #region Properties
        /// <summary>
        /// [id_pertanyaan] CHAR(5) PRIMARY KEY
        /// </summary>
        public string IdPertanyaan
        {
            get { return this.idPertanyaan; }
            set { this.idPertanyaan = value; }
        }

        /// <summary>
        /// [pertanyaan] TEXT NOT NULL
        /// </summary>
        public string IsiPertanyaan
        {
            get { return this.isiPertanyaan; }
            set { this.isiPertanyaan = value; }
        }

        /// <summary>
        /// [pilihan_jawaban1] TEXT NOT NULL
        /// </summary>
        public string PilihanJawaban1
        {
            get { return this.pilihanJawaban1; }
            set { this.pilihanJawaban1 = value; }
        }

        /// <summary>
        /// [pilihan_jawaban2] TEXT NOT NULL
        /// </summary>
        public string PilihanJawaban2
        {
            get { return this.pilihanJawaban2; }
            set { this.pilihanJawaban2 = value; }
        }

        /// <summary>
        /// [pilihan_jawaban3] TEXT NOT NULL
        /// </summary>
        public string PilihanJawaban3
        {
            get { return this.pilihanJawaban3; }
            set { this.pilihanJawaban3 = value; }
        }

        /// <summary>
        /// [pilihan_jawaban4] TEXT NOT NULL
        /// </summary>
        public string PilihanJawaban4
        {
            get { return this.pilihanJawaban4; }
            set { this.pilihanJawaban4 = value; }
        }

        public int BobotPillihanJawaban1
        {
            get { return this.bobotPillihanJawaban1; }
            set { this.bobotPillihanJawaban1 = value; }
        }

        public int BobotPillihanJawaban2
        {
            get { return this.bobotPillihanJawaban2; }
            set { this.bobotPillihanJawaban2 = value; }
        }

        public int BobotPillihanJawaban3
        {
            get { return this.bobotPillihanJawaban3; }
            set { this.bobotPillihanJawaban3 = value; }
        }

        public int BobotPillihanJawaban4
        {
            get { return this.bobotPillihanJawaban4; }
            set { this.bobotPillihanJawaban4 = value; }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Pertanyaan()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idPertanyaan">[id_pertanyaan] CHAR(5) PRIMARY KEY</param>
        /// <param name="pertanyaan">[pertanyaan] TEXT NOT NULL</param>
        /// <param name="pilihanJawaban1">[pilihan_jawaban1] TEXT NOT NULL</param>
        /// <param name="pilihanJawaban2">[pilihan_jawaban2] TEXT NOT NULL</param>
        /// <param name="pilihanJawaban3">[pilihan_jawaban3] TEXT NOT NULL</param>
        /// <param name="pilihanJawaban4">[pilihan_jawaban4] TEXT NOT NULL</param>
        public Pertanyaan(string idPertanyaan, string pertanyaan, string pilihanJawaban1, string pilihanJawaban2, string pilihanJawaban3, string pilihanJawaban4, int bobotPillihanJawaban1, int bobotPillihanJawaban2, int bobotPillihanJawaban3, int bobotPillihanJawaban4)
        {
            this.idPertanyaan = idPertanyaan;
            this.isiPertanyaan = pertanyaan;
            this.pilihanJawaban1 = pilihanJawaban1;
            this.pilihanJawaban2 = pilihanJawaban2;
            this.pilihanJawaban3 = pilihanJawaban3;
            this.pilihanJawaban4 = pilihanJawaban4;
            this.bobotPillihanJawaban1 = bobotPillihanJawaban1;
            this.bobotPillihanJawaban2 = bobotPillihanJawaban2;
            this.bobotPillihanJawaban3 = bobotPillihanJawaban3;
            this.bobotPillihanJawaban4 = bobotPillihanJawaban4;
        }
        #endregion

        public override string ToString()
        {
            return string.Format("ID_PERTANYAAN: {0} | PERTANYAAN: {1} | PILIHAN_JAWABAN1: {2} | PILIHAN_JAWABAN2: {3} | PILIHAN_JAWABAN4: {4} | BOBOT_PILLIHAN_JAWABAN1: {5} | BOBOT_PILLIHAN_JAWABAN2: {6} | BOBOT_PILLIHAN_JAWABAN3: {7} | BOBOT_PILLIHAN_JAWABAN4: {8}", this.idPertanyaan, this.isiPertanyaan, this.pilihanJawaban1, this.pilihanJawaban2, this.pilihanJawaban3, this.pilihanJawaban4, this.bobotPillihanJawaban1, this.bobotPillihanJawaban2, this.bobotPillihanJawaban3, this.bobotPillihanJawaban4);
        }

    }
}
